<?php require_once 'common/adminHeader.php';?>
<div class="nav">
当前位置：教师应聘>><a href="<?php echo siteUrl('teacher/teacherlist')?>">老师列表</a>
</div>

<script language="javascript">
function CheckAll(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.name != 'chkall')
		e.checked = form.chkall.checked;
	}
}

function ctrl(action)
{
	if(action == "export")
	{
		window.open("<?php echo siteUrl('teacher/exportexcel')?>?menu=export","_blank");
		return;
	}

	var form = document.getElementById("form1");
	var sign = false;
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.name != "chkall" && e.checked) sign = true;
	}

	if(!sign){
		alert("您还没有选择！");
		return;
	}
	form.action = "<?php echo siteUrl('teacher/exportexcel').'?gradeId=1&';?>menu=" + action;
	form.submit();
}
</script>

<form name="form1" id="form1" method="post" action="">
	<table class="tableClass"  width="100%"  border="0" cellpadding="0" cellspacing="1">
	<tr>
			<td width="50"><input type="checkbox" value="ON" onclick="CheckAll(this.form)" name="chkall"></td>
			<td width="150">老师姓名</td>
			<td width="150">手机号码</td>
			<td width="150">注册时间</td>
			<td width="50">状态</td>
			<td>编辑</td>
	</tr>
<?php if ($form_data->list):?>
<?php foreach ($form_data->list as $key=>$value):?>
	<tr>
		<td><input type="checkbox" value="<?php echo $value['Id'];?>" name="Id[]"></td>
		<td><?php echo $value['TeacherName'];?></td>
		<td><?php echo $value['Mobile'];?></td>
		<td><?php echo $value['RegistTime'];?></td>
		<td><?php if($value['RegistStatus']==0){echo "未查看";}elseif ($value['RegistStatus']==1){ echo "已查看";}elseif ($value['RegistStatus']==2){ echo "已致电";}?></td>
		<td>
			<a target="_blank" href ="<?php echo siteUrl('teacher/teacherView?teacherId='.$value['Id'])?>">查看</a> 
			<a href ="<?php echo siteUrl('teacher/teacherEdit?teacherId='.$value['Id'])?>">修改</a> 
			<a href ="<?php echo siteUrl('teacher/teacherdel?teacherId='.$value['Id'])?>">删除</a>
		</td>
	</tr>
<?php endforeach; else:  echo '<tr><td colspan="6">暂时没有老师</td></tr>'; endif;  echo "</table>";?>
<br>

<a class="adminbutton" onclick="ctrl('exportExcel')" href="#">导出Excel</a>
</form>